function href(url){var good_id_1=window.location.href.replace(/(.*)Product\/Pro([0-9]+)(.*)\.html$/gi, "$2");var good_id_2=url.replace(/(.*)Product\/Pro([0-9]+)(.*)\.html$/gi, "$2");addNumber("GET",baseURL+'ajax.php?act=statistics&good_id_1='+good_id_1+'&good_id_2='+good_id_2,true,href_onblur,[url]);}
function href_onblur(xmlHttp,parameter,Unsuccessful){window.location.href=parameter[0];}
function window_page_header_onload(baseURL){ }
function upMycartAmount(xmlHttp,parameter,Unsuccessful){if(Unsuccessful != 'Unsuccessful'){document.getElementById('mycartAmount').innerHTML=xmlHttp.responseText;}
}
subcartlistK=true;function subcartlist(baseURL){if(subcartlistK){subcartlistK=false;addNumber("GET",baseURL+'ajax.php?act=cartlist',true,serversubcartlist);}
}
function closesubcartlist(e){if(!iscontains(document.getElementById('tempcartDiv'),e)){subcartlistK=true;}
}
function serversubcartlist(xmlHttp,parameter,Unsuccessful){if(Unsuccessful != 'Unsuccessful'){document.getElementById('tempcartlist').innerHTML=xmlHttp.responseText;}
}
function validate(){var keywords=document.getElementById('keywords_id');if(keywords.value!=keywords.defaultValue){thisform.submit();}else{keywords.focus();return false;}
}
function jt_addBookmark(a) {var b='http:\/\/www.huolida.com\/';addfavor(b,a);}
function addfavor(url,title) {var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("msie 8")>-1)
{}else{try {window.external.addFavorite(url, title);}
catch(e) {try {window.sidebar.addPanel(title, url, "");} catch(e) {alert("加入收藏失败，请使用Ctrl+D进行添加");}
}
}
return false;}
var K_Mark=1;var K_nub=0;function Rotation_K(){function __interval()
{if(K_Mark==1){temp_lis=document.getElementById('Rotation_K').getElementsByTagName('li');if(K_nub < temp_lis.length-1){K_nub=K_nub+1;displayKimg(temp_lis[K_nub]);}else{K_nub=0;displayKimg(temp_lis[K_nub]);}
}
setTimeout(__interval,5000);}
setTimeout(__interval,5000);}
function displayKimg(self){var K_lis=self.parentNode.getElementsByTagName('li');var Img_lis=self.parentNode.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('a');for(var i=0; i<K_lis.length; i++){if(K_lis[i]==self){K_nub=i;K_lis[i].className='li_hover'
K_lis[i].getElementsByTagName('a')[0].style.color='#FFFFFF';Img_lis[i].style.display='';}else{K_lis[i].className=''
Img_lis[i].style.display='none';K_lis[i].getElementsByTagName('a')[0].style.color='';}
}
}
function displaySubMenu(li,_function,baseURL) {var subMenu=li.getElementsByTagName("ul")[0];subMenu.style.display="block";if (typeof(_function)==="function"){_function.call(self,baseURL);}
}
function hideSubMenu(li,_function,e) {var subMenu=li.getElementsByTagName("ul")[0];if(e!=''){if(!iscontains(li,e)){subMenu.style.display="none";}
}else{subMenu.style.display="none";}
if (typeof(_function)==="function"){_function.call(self,e);}
}
function pagination_ur_go(url,self){page=self.parentNode.getElementsByTagName('input')[0];window.location.href=url.replace('_page_',page.value);}
function _bookmark(title, url) {if (document.all)
window.external.AddFavorite(url, title);else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}
function layer_toggle(obj) {document.getElementById('layAccount').style.height="100px";document.getElementById('tab01off').style.display="none";if (obj.style.display=='none')
obj.style.display='block';else if (obj.style.display=='block')
obj.style.display='none';}
function layer_close(){document.getElementById('layAccount').style.height="32px";document.getElementById('tab01off').style.display="";document.getElementById('tab01on').style.display="none";document.getElementById('tab02off').style.display="none";document.getElementById('tab02on').style.display="none";document.getElementById('tab03off').style.display="none";document.getElementById('tab03on').style.display="none";document.getElementById('tab04off').style.display="none";document.getElementById('tab04on').style.display="none";}
var pingluen_array=new Array();var pingluen_k=true;var pingluen_w;var pingluen_bottom;function pingluen(w){if(pingluen_k){pingluen_w=w;var pingluenobj=document.getElementById(w);if(pingluenobj){if(parseInt(getCookie(w))!=0){pingluenobj.style.display='';pingluen_bottom=-160;pingluenobj.style.marginBottom=pingluen_bottom + 'px';pingluen_k=false;pingluenBottom();}
}
}else{if(is_array(pingluen_array)){pingluen_array.push(w);}else{pingluen_array=new Array();pingluen_array.push(w);}
}
}
function pingluenBottom(){pingluen_bottom += 5;document.getElementById(pingluen_w).style.marginBottom=pingluen_bottom + 'px';if(pingluen_bottom < 5){setTimeout("pingluenBottom()",10);}else{pingluen_k=true;if(is_array(pingluen_array)){try{var tempt_w=pingluen_array.shift();pingluen(tempt_w);}catch (ex){}
}
}
}
function pingluen_close(w){SetCookie(w,0);document.getElementById(w).style.display='none';}
function isNull(anode){if (anode.toString()=='undefined'){ return true;}
else{if (anode.toString()=='NULL'){ return true;}
else{return false;}
}
}
function LRtrim(str)
{var p=/(^\s*)|(\s*$)/g
str=str.replace(p,""); return str;}
function is_array(test)
{if(typeof test=='object' && typeof test.sort=='function' && typeof test.length=='number'){return true;} else {return false;}
}
function get_iframe(_document,id,name){if(_document=='' || _document==null){_document=window.document;}
if(name=='' || name==null){name=id;}
if (window.ActiveXObject){doc=_document.frames[name];}else{doc=_document.getElementById(id);}
return doc;}
function getEventObject(W3CEvent) {return W3CEvent || window.event;}
function toDecimal2(x) {var f=parseFloat(x);if (isNaN(f)) {return false;}
var f=Math.round(x*100)/100;var s=f.toString();var rs=s.indexOf('.');if (rs < 0) {rs=s.length;s += '.';}
while (s.length <= rs + 2) {s += '0';}
return s;}
function XmouseCoords(ev,_x,_y){ev=ev || getEventObject(ev);var x=ev.pageX || (ev.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft));var y=ev.pageY || (ev.clientY + (document.documentElement.scrollTop || document.body.scrollTop));return {'x':x + _x,
'y':y + _y
};}
function getxy(e){var a=new Array()
var t=e.offsetTop;var l=e.offsetLeft;var w=e.offsetWidth;var h=e.offsetHeight;while(e=e.offsetParent){t+=e.offsetTop;l+=e.offsetLeft;}
a[0]=t;a[1]=l;a[2]=w;a[3]=h
return {left:l,top:t};}
function iscontains(obj, theEvent){if (theEvent){var browser=navigator.userAgent;if (browser.indexOf("Firefox")>0){ 　if (obj.contains(theEvent.relatedTarget)) { 　　 return true;}
}
if (browser.indexOf("MSIE")>0){if (obj.contains(event.toElement)) {return true;}
}
return false;}
return false;}
if(typeof(HTMLElement)!="undefined")
{HTMLElement.prototype.contains=function(obj)
{while(obj!=null&&typeof(obj.tagName)!="undefind"){if(obj==this) return true;obj=obj.parentNode;}
return false;};}
function SetCookie(name,value)
{var Days=30;var exp=new Date();exp.setTime(exp.getTime() + Days*24*60*60*1000);document.cookie=name + "="+ escape (value);}
function getCookie(name)
{var arr=document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));if(arr != null)
return unescape(arr[2]);return null;}
function delCookie(name)
{var exp=new Date();exp.setTime(exp.getTime() - 1);var cval=getCookie(name);if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();}
function show_date_time(timeold, onlyhour){ if(timeold<=0){return false;}
if (onlyhour==1){_day=0
_hrsold=Math.floor(timeold/(60*60)*1)
}else{_day=Math.floor(timeold/(60*60*24)*1)
_hrsold=Math.floor((timeold%(60*60*24))/(60*60)*1)
}
_minsold=Math.floor(((timeold%(60*60*24))%(60*60))/(60)*1)
_seconds=Math.floor((((timeold%(60*60*24))%(60*60))%(60))/1)
return {day:_day,hrsold:_hrsold,minsold:_minsold,seconds:_seconds};}
var _xmlHttp;var RequestQueue_fashion=new Array();var RequestQueue_url=new Array();var RequestQueue_dll=new Array();var RequestQueue_function=new Array();var RequestQueue_parameter=new Array();var RequestSwitch=1;function createXMLHttpRequest()
{ if(window.ActiveXObject) { _xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } else if(window.XMLHttpRequest) { _xmlHttp=new XMLHttpRequest(); }
}
function addNumber(_fashion,_url,_dll,_function,parameter)
{if(_fashion==undefined){return '';}
if(RequestSwitch==1){RequestSwitch=0;createXMLHttpRequest();_xmlHttp.open(_fashion,_url,_dll);_xmlHttp.onreadystatechange=function(){ReturnChat(_function,parameter);};_xmlHttp.setRequestHeader("If-Modified-Since","0");_xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");_xmlHttp.send(null);}else{if(is_array(RequestQueue_fashion)){RequestQueue_fashion.push(_fashion);RequestQueue_url.push(_url);RequestQueue_dll.push(_dll);RequestQueue_function.push(_function);RequestQueue_parameter.push(parameter);}else{RequestQueue_fashion=new Array();RequestQueue_url=new Array();RequestQueue_dll=new Array();RequestQueue_function=new Array();RequestQueue_parameter=new Array();RequestQueue_fashion.push(_fashion);RequestQueue_url.push(_url);RequestQueue_dll.push(_dll);RequestQueue_function.push(_function);RequestQueue_parameter.push(parameter);}
}
}
function ReturnChat(callback,parameter)
{if(_xmlHttp.readyState==4)
{if(_xmlHttp.status==200)
{RequestSwitch=1;if (typeof(callback)==="function"){callback.call(self,_xmlHttp,parameter);}else{}
if(is_array(RequestQueue_fashion)){try{temp_fashion=RequestQueue_fashion.shift();temp_url=RequestQueue_url.shift();temp_dll=RequestQueue_dll.shift();temp_function=RequestQueue_function.shift();temp_parameter=RequestQueue_parameter.shift();addNumber(temp_fashion,temp_url,temp_dll,temp_function,temp_parameter);}catch (ex){}
}
}
else if(_xmlHttp.status==202){window.alert("请求被接收");}
else if(_xmlHttp.status==400){window.alert("错误的请求");}
else if(_xmlHttp.status==404){window.alert("请求资源未找到");}
else if(_xmlHttp.status==500){window.alert("内部服务器错误，如.net代码错误等");}
}else{if (typeof(callback)==="function"){callback.call(self,_xmlHttp,parameter,'Unsuccessful');}else{}
}
}
var waitComplete={wait_Complete : false,
responseComplete : false,
w_xmlHttp:null,
w_parameter:null,
w_Unsuccessful:null,
w_callback:null,
w_end : false,
wait:function (w__xmlHttp,w__parameter,w__Unsuccessful,w__callback){if(this.w_xmlHttp==null){this.w_xmlHttp=w__xmlHttp;}
if(this.w_parameter==null){this.w_parameter=w__parameter;}
if(this.w_Unsuccessful==null){this.w_Unsuccessful=w__Unsuccessful;}
if(this.w_callback==null){this.w_callback=w__callback;}
if(w__Unsuccessful=='Unsuccessful'){window.Obj=this;setTimeout('Obj.transit()',1000);}else{this.responseComplete=true;this.execution();}
},
transit:function (){if(this.wait_Complete==false){this.wait_Complete=true;}
this.execution();},
execution:function (){if(!this.w_end){if(this.wait_Complete && this.responseComplete){this.w_end=true;this.wait_Complete=false; this.responseComplete=false;this.w_callback.call(self,this.w_xmlHttp,this.w_parameter,true);}else{this.w_callback.call(self,this.w_xmlHttp,this.w_parameter,false);}
}
},
again:function(){this.wait_Complete=false;this.responseComplete=false;this.w_xmlHttp=null;this.w_parameter=null;this.w_Unsuccessful=null;this.w_callback=null;this.w_end=false;}
}
function addfavor(url,title) {var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("msie 8")>-1){}else{try {window.external.addFavorite(url, title);} catch(e) {try {window.sidebar.addPanel(title, url, "");} catch(e) {alert("加入收藏失败，请使用Ctrl+D进行添加");}
}
}
return false;}
function Utf8ToUnicode(strUtf8)
{ var bstr=""; var nTotalChars=strUtf8.length; var nOffset=0; var nRemainingBytes=nTotalChars; var nOutputPosition=0; var iCode, iCode1, iCode2; while (nOffset < nTotalChars) { iCode=strUtf8.charCodeAt(nOffset); if ((iCode & 0x80)==0) { if ( nRemainingBytes < 1 ) break; bstr += String.fromCharCode(iCode & 0x7F); nOffset ++; nRemainingBytes -= 1; } else if ((iCode & 0xE0)==0xC0) { iCode1=strUtf8.charCodeAt(nOffset + 1); if ( nRemainingBytes < 2 || (iCode1 & 0xC0) != 0x80 ) { break; } bstr += String.fromCharCode(((iCode & 0x3F) << 6) | ( iCode1 & 0x3F)); nOffset += 2; nRemainingBytes -= 2; } else if ((iCode & 0xF0)==0xE0) { iCode1=strUtf8.charCodeAt(nOffset + 1); iCode2=strUtf8.charCodeAt(nOffset + 2); if ( nRemainingBytes < 3 || (iCode1 & 0xC0) != 0x80 || (iCode2 & 0xC0) != 0x80 ) { break; } bstr += String.fromCharCode(((iCode & 0x0F) << 12) | ((iCode1 & 0x3F) << 6) | (iCode2 & 0x3F)); nOffset += 3; nRemainingBytes -= 3; } else break; } if (nRemainingBytes != 0) { return ""; } return bstr;}